<?xml version="1.0" encoding="utf-8"?>
<resources>
	<string name="sql_update_config">
	
	</string>
	
	<string-array name="sql_drop_tables">
    	<item>
    	drop table IF EXISTS TERMIINAL
    	</item>
    	<item>
    	drop table IF EXISTS POLICES
    	</item>
    	<item>
    	drop table IF EXISTS COMPANIES
    	</item>
    	<item>
    	drop table IF EXISTS PERSONS
    	</item>
    	<item>
    	drop table IF EXISTS NOTICES
    	</item>
    	<item>
    	drop table IF EXISTS TRANSACTIONS
    	</item>
    	<item>
    	drop table IF EXISTS CONFIG
    	</item>
    	<item>
    	drop table IF EXISTS BLUETOOTH
    	</item>    	
    	<item>
    	drop table IF EXISTS CODES
    	</item>
    	<item>
    	drop table IF EXISTS PRECODES
    	</item>
    </string-array>
    
    <string-array name="sql_create_tables">
    	<item>
	    CREATE TABLE IF NOT EXISTS TERMIINAL
		(
		    TerminalId VARCHAR NOT NULL,
		    TerminalCode VARCHAR NOT NULL,
		    TerminalPassword VARCHAR NOT NULL,
		    TerminalPhoneNumber VARCHAR NOT NULL,
		    TerminalType VARCHAR NOT NULL,
		    TerminalStatus VARCHAR NOT NULL,
		    TerminalArea VARCHAR NOT NULL,
		    TerminalCreateTime VARCHAR,
		    TerminalChangeTime VARCHAR,
		    TerminalComment  VARCHAR
		)
    	</item>
    	<item>
	    CREATE TABLE IF NOT EXISTS POLICES
		(
		    PoliceId VARCHAR NOT NULL,
		    PoliceArea VARCHAR NOT NULL,
		    PoliceName VARCHAR NOT NULL,
		    PolicePhoneNumber VARCHAR,
		    PoliceCardImageId VARCHAR,
		    PoliceCardImage BLOB,
		    PoliceWorkingStatus VARCHAR NOT NULL,
		    PoliceCreateTime VARCHAR,
		    PoliceChangeTime VARCHAR,
		    PoliceComment VARCHAR
		)
    	</item>    	
    	<item>
	    CREATE TABLE IF NOT EXISTS COMPANIES
		(
		    CompanyId VARCHAR NOT NULL,
		    CompanyType VARCHAR NOT NULL,
		    CompanyName VARCHAR NOT NULL,
		    CompanyAddress VARCHAR,
		    CompanyArea VARCHAR NOT NULL,
		    CompanyLegalPerson VARCHAR,
		    CompanySecurityPerson VARCHAR,
		    CompanyPhoneNumber VARCHAR,
		    CompanyEastPoint VARCHAR,
		    CompanyNorthPoint VARCHAR,
		    CompanyOveralImage BLOB,
		    CompanyPoliceId VARCHAR NOT NULL,
		    CompanyTerminalId  VARCHAR NOT NULL,
		    CompanyCreateTime VARCHAR,
		    CompanyChangeTime VARCHAR,
		    CompanyComment VARCHAR
		)
    	</item>
    	<item>
	    CREATE TABLE IF NOT EXISTS PERSONS
		(
		    PersonId VARCHAR NOT NULL,
		    PersonCompanyId VARCHAR NOT NULL,
		    PersonPoliceId VARCHAR NOT NULL,
		    PersonTerminalId VARCHAR NOT NULL,
		    PersonTransactionId VARCHAR NOT NULL,
		    PersonCompanyType VARCHAR NOT NULL,
		    PersonCardType VARCHAR NOT NULL,
		    PersonCardId VARCHAR,
		    PersonName VARCHAR,
		    PersonSex VARCHAR,
		    PersonNation VARCHAR,
		    PersonNative VARCHAR,
		    PersonBirthday VARCHAR,
		    PersonAddress VARCHAR,
		    PersonPhoneNumber VARCHAR,
		    PersonEastPoint VARCHAR,
		    PersonNorthPoint VARCHAR,
			PersonCardImage BLOB,
			PersonRealImage BLOB,
			PersonComment VARCHAR,
			PersonStatus  VARCHAR,
			
			CheckInTime VARCHAR,
			CheckOutTime VARCHAR,
			AutoCheckOut VARCHAR,
			Office VARCHAR,
			Job VARCHAR,
			CheckReason VARCHAR,
			PersonCreateTime VARCHAR,
			PersonChangeTime VARCHAR,
			
			PersonDate VARCHAR,
		    PersonIndex INT,
		    PersonUpload INT
		)
    	</item>

    	<item>
	    CREATE TABLE IF NOT EXISTS NOTICES
		(
		    NoticeId VARCHAR NOT NULL,
			NoticeType VARCHAR,
			NoticeArea VARCHAR,
			NoticeTitle VARCHAR,
			NoticeContent VARCHAR,
			NoticeAuthor VARCHAR,
			NoticeCreateTime VARCHAR,
			NoticeEffectiveTime VARCHAR,
			NoticeComment VARCHAR
		)
    	</item>
    	<item>
	    CREATE TABLE IF NOT EXISTS TRANSACTIONS
		(
			TransactionId VARCHAR NOT NULL,
		    TransactionTerminalId VARCHAR NOT NULL,
		    TransactionCompanyId VARCHAR NOT NULL,
		    TransactionPoliceId VARCHAR NOT NULL,
		    TransactionPoliceImage BLOB,
		    TransactionEastPoint VARCHAR,
		    TransactionNorthPoint VARCHAR,
		    TransactionComment VARCHAR,
		    TransactionDate VARCHAR,
		    TransactionIndex INT
		)
    	</item>
    	<item>
	    CREATE TABLE IF NOT EXISTS BLUETOOTH
		(
		    DeviceName VARCHAR,
		    DeviceAddress VARCHAR,
		    DeviceType VARCHAR
		)
    	</item>
    	<item>
	    CREATE TABLE IF NOT EXISTS CONFIG
		(
		    Version VARCHAR,
		    ServerIP VARCHAR,
		    NoticeCheckLong INT,
		    PersonCheckLong INT,
		    PosCheckLong INT,
		    StoreMaxCount INT
		)
    	</item>
    	<item>
	    CREATE TABLE IF NOT EXISTS KEYS
		(
		    KeyName VARCHAR,
		    KeyValue VARCHAR
		)
    	</item>
    	<item>
	    CREATE TABLE IF NOT EXISTS CODES
		(
			Type VARCHAR NOT NULL,
		    Value VARCHAR NOT NULL,
		    Name VARCHAR NOT NULL,
		    Code VARCHAR,
		    Comment VARCHAR
		)
    	</item>
    	<item>
	    CREATE TABLE IF NOT EXISTS PRECODES
		(
			Type VARCHAR NOT NULL,
		    Content TEXT
		)
    	</item>
    </string-array> 
</resources>
